package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
    private TextView tvMainTitle;
    private RecyclerView rvMainUsers;
    private List<Users> list=new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        list.add(new Users(1,"张三",28,98));
        list.add(new Users(2,"李四",25,88));
        rvMainUsers.setAdapter(new UsersAViewAdapter(list));
    }

    private void initView() {
        tvMainTitle = (TextView) findViewById(R.id.tvMainTitle);
        rvMainUsers = (RecyclerView) findViewById(R.id.rvMainUsers);
        rvMainUsers.setLayoutManager(new LinearLayoutManager(this));
    }
}